<?php 
/*
 * This is an example of a web page which prints out attributes of users
 * who are logged in.
 */

/* Load lasso helper library. */
require_once('lasso.php');


?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>FEIDE Lasso PHP example.</title>
</head>
<body>
<h1>FEIDE Lasso PHP example.</h1>

<?php

/* The default implementation stores the attributes in the LP_ATTRS if the
 * user is logged in.
 */
if($_SESSION['LP_ATTRS']) {
  /* The user is logged in - display a logout url, and list attributes. */

?>

<p>You are logged in. <a href="logout.php">Log out.</a></p>
<table>
<?php

   foreach($_SESSION['LP_ATTRS'] as $name => $values) {
     foreach($values as $value) {
       echo('<tr><td>' . $name . '</td><td>' . $value . '</td></tr>' . "\n");
     }
   }

?>
</table>
<?

} else {
  /* The user isn't logged in. Display a login url. */

?>

<p>You are not logged in. <a href="login.php">Log in.</a></p>

<?php
}

?>

</body>
</html>
